﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iot.Models
{
    public class PointInfo
    {
        public Guid guid { get; set; }

        public Guid PLCinfoId { get; set; }

        public PlcInfo PLC { get; set; }  // 导航到关联表

        // 方式1：通过导航属性间接获取
        public string? device_code => PLC?.device_code;  // 通过导航对象取值‌:ml-citation{ref="6" data="citationList"}

        public string dataType { get; set; }
        public int? DetectionValue_Qty { get; set; }
        /// <summary>
        /// 点位名称
        /// </summary>
        public string point_name { get; set; }
        /// <summary>
        /// 点位地址
        /// </summary>
        public string address { get; set; }
        public string limit_type { get; set; }
        /// <summary>
        /// 数据类型
        /// </summary>
        /// 
        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsActive { get; set; }
        /// <summary>
        /// 换算比
        /// </summary>
        public double Conversion { get; set; } = 1;


        public int collectionFrequency { get; set; } = 5000;

        public string Value { get; set; }

        public string[]? Values { get; set; }

        public string error { get; set; }

        public double? lowerCurrentLimit { get; set; }

        public double? upperCurrentLimit { get; set; }

        public double? upperSpanLimit { get; set; }

        public double? lowerSpanLimit { get; set; }

        public string? equation { get; set; }

        public string? pointType { get; set; }

        public string? msType { get; set; }
        public Dictionary<int, Dictionary<string, string>> pointData { get; set; }
    }
}
